package io.gitee.chearnee.fw.openapi.result.page;

import cn.hutool.core.text.CharSequenceUtil;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Collections;

/**
 * 分页对象
 *
 * @author yangzhi
 * @Date 2021/9/22 10:47
 **/
@Data
@AllArgsConstructor
public class PageResult<T> {

  /**
   * 总条数
   */
  private Long total;
  /**
   * 当前返回条数
   */
  private Integer count;
  /**
   * 数据内容
   */
  private T data;
  /**
   * 当前最后的ID
   */
  private String nextId;

  public static PageResult empty() {
    return new PageResult<>(0L, 0, Collections.emptyList(),
        CharSequenceUtil.EMPTY);
  }


}
